<?php $this->load->view('layout/header'); ?>
<?php js('skins', 'tourism')?>
<div class="supplier-content-page">
    <div class="product-test-h5">
        <ul class="breadcrumb">
            <li><a href="javascript:;">商品管理</a></li>
            <li><a href="<?php echo site_url('tourismtemplet/grid') ?>">运费模版</a></li>
            <li  class="active"><a href="javascript:;">编辑运费模板</a></li>
        </ul>
        <?php echo execute_alert_message() ?>
        <div class="product-alls">
            <div class="product-fonter">修改运费模板</div>
            <form class="form-horizontal" action="<?php echo site_url('tourismtemplet/editPost')?>" method="post" id="tourismtemplet_edit">
                <div class="form-group">
                    <label class="col-sm-1 control-label">模板名称</label>
                    <div class="col-xs-6">
                        <input type="text" class="form-control" name="name" value="<?php echo $template->name ?>">
                        <input type="hidden" class="form-control template_edit_id" name="id" value="<?php echo $this->uri->segment(3) ?>">
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label">快递方式</label>
                    <div class="col-xs-6 control-right-label">
                        <ul>
                            <li class="radio"><label><input type="radio" name="logistics" value="1" <?php if($template->logistics == 1): ?>checked="checked" <?php endif; ?>>快递</label></li>
                            <li class="radio"><label><input type="radio" name="logistics" value="2" <?php if($template->logistics == 2): ?>checked="checked" <?php endif; ?>>物流</label></li>
                        </ul>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-sm-1 control-label">计价方式</label>
                    <div class="col-xs-6 control-right-label clearfix">
                        <ul>
                            <li class="radio"><label><input type="radio"  key="1"  name="methods" value="1" <?php if($template->methods == 1): ?>checked="checked" <?php endif; ?>>件</label></li>
                            <li class="radio"><label><input type="radio"  key="2"  name="methods" value="2" <?php if($template->methods == 2): ?>checked="checked" <?php endif; ?>>重量</label></li>
                        </ul>
                    </div>
                </div>

                <div class="product-footer">

                    <div class="order weight clearfix" <?php if($template->methods != 2): ?>style="display: none;"<?php endif;?> >
                        <p>默认运费
                            <input type="text" name="weight_first_unit"  value="<?php echo isset($defaultList->first_unit)?$defaultList->first_unit:'';?>" class="text">公斤内，
                            <input type="text" name="weight_first_price" value="<?php echo isset($defaultList->first_price)?$defaultList->first_price:'';?>" class="text">元，每增加
                            <input type="text" name="weight_add_unit"    value="<?php echo isset($defaultList->add_unit)?$defaultList->add_unit:'';?>" class="text">公斤，增加
                            <input type="text" name="weight_add_price"   value="<?php echo isset($defaultList->add_price)?$defaultList->add_price:''; ?>" class="text">元
                        </p>
                        <a href="javascript:;">设置各地运费标准</a>
                    </div>
                    <div class="order piece clearfix" <?php if($template->methods != 1): ?>style="display: none;" <?php endif;?>>
                        <p>默认运费
                            <input type="text" name="piece_first_unit"  value="<?php echo isset($defaultList->first_unit)?$defaultList->first_unit:''; ?>" class="text">件内，
                            <input type="text" name="piece_first_price" value="<?php echo isset($defaultList->first_price)?$defaultList->first_price:''; ?>" class="text">元，每增加
                            <input type="text" name="piece_add_unit"    value="<?php echo isset($defaultList->add_unit)?$defaultList->add_unit:''; ?>" class="text">件，增加
                            <input type="text" name="piece_add_price"   value="<?php echo isset($defaultList->add_price)?$defaultList->add_price:''; ?>" class="text">元
                        </p>
                        <a href="javascript:;">设置各地运费标准</a>
                    </div>

                    <div class="odr-table">

                    </div>

                </div>
                <div class="form-btn">
                    <a href="javascript:;">
                        <button class="btn btn-info" >保存</button>
                    </a>
                    <a href="<?php echo site_url('tourismtemplet/grid');?>">返回上一步</a>
                </div>
            </form>
            <?php $this->load->view('tourismtemplet/area')?>
        </div>
    </div>
</div>
<script type="text/javascript">
    $('.form-btn').on('click','.btn-info',function(){
        if(!$('#tourismtemplet_edit').valid()){
            return false;
        }
    });
</script>
<?php $this->load->view('layout/footer'); ?>
